package com.bjsxt.service;

import com.bjsxt.domain.Account;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

/**
* @date:2022/1/13 20:50
* @author:yang
*/
public interface AccountService extends IService<Account>{

    /**
     * 用户资金的划转
     * @param adminId
     * @param userId
     * @param coinId
     * @param orderNum
     * @param num
     * @param fee
     * @param remark
     * @param businessType
     * @param direction
     * @return
     */
    Boolean transferAccountAmount(Long adminId, Long userId, Long coinId,Long orderNum , BigDecimal num, BigDecimal fee,String remark,String businessType,Byte direction);

    /**
     * 给用户扣减钱
     * @param adminId
     * @param userId
     * @param coinId
     * @param orderNum
     * @param num
     * @param fee
     * @param remark
     * @param businessType
     * @param direction
     * @return
     */
    Boolean decreaseAccountAmount(Long adminId, Long userId, Long coinId, Long orderNum ,BigDecimal num, BigDecimal fee,String remark, String businessType, byte direction);

    /**
     * 查询当前用户的货币资产状况
     * @param userId
     * @param coinName
     * @return
     */
    Account findByUserAndCoin(Long userId, String coinName);

    /**
     * 暂时锁定用户资产
     * @param userId
     * @param coinId
     * @param mum
     * @param withdrawals_out
     * @param id
     * @param fee
     */
    void lockUserAmount(Long userId, Long coinId, BigDecimal mum, String withdrawals_out, Long id, BigDecimal fee);
}
